Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- When using Oracle Data Pump (`expdp` and `impdp`) from the command line in Windows, and if you're logged in as a user with sufficient privileges (like "System"), you don't necessarily need to specify a connection string if you're performing the operation on the local database. In such a case, Oracle uses the default database defined in your environment.
- Here's how you would use Data Pump without explicitly specifying a connection string:
- 1. **Export the Old User's Schema**:
- ```shell
- expdp "old_user"/password DIRECTORY=directry DUMPFILE=old_user.dmp SCHEMAS=old_user
- ```
- - Replace `password` with the actual password of "old_user".
- - Ensure that the `DIRECTORY` parameter matches the Oracle directory object you've created that points to a path on disk D.
- 2. **Create the New User** (if not already created):
- - This step is done via SQL*Plus or a similar Oracle client.
- 3. **Import the Schema into the New User**:
- ```shell
- impdp "new_user"/new_password DIRECTORY=directry DUMPFILE=old_user.dmp REMAP_SCHEMA=old_user:new_user
- ```
- - Replace `new_password` with the actual password of "new_user".
- If you are running these commands on the same machine where the Oracle database server is installed, and if you're using the default instance, you don't need to worry about the connection string. Oracle will connect to the default local database. However, if you are working with a remote database or a specific instance, you would need to specify the connection string or ensure that your Oracle environment variables are set correctly to point to the right database.
- Also, remember that running these commands with the "System" user might give you broad access, so it's crucial to be cautious to avoid unintended changes in the database.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement