Let $F\,{=}\,\{H_1,\ldots,H_k\}$ be a family of graphs. A graph $G$ is called totally$F$-decomposable if for every linear combination of the form $\alpha_1 e(H_1) \,{+}\,{\cdots}\,{+}\,\alpha_k e(H_k) \,{=}\, e(G)$ where each $\alpha_i$ is a nonnegative integer, there is a colouring of the edges of $G$ with $\alpha_1\,{+}\,{\cdots}\,{+}\,\alpha_k$ colours such that exactly $\alpha_i$ colour classes induce each a copy of $H_i$, for $i\,{=}\,1,\ldots,k$. We prove that if $F$ is any fixed nontrivial family of trees then $\log n/n$ is a sharp threshold function for the property that the random graph $G(n,p)$ is totally $F$-decomposable. In particular, if $H$ is a tree with more than one edge, then $\log n/n$ is a sharp threshold function for the property that $G(n,p)$ contains $\lfloor e(G)/e(H) \rfloor$ edge-disjoint copies of $H$.