Oracle Maintenance Utilities
Please use PersephoneShell to initialize the database schema
Note! The rest of this section is provided as a reference only, no need to go this route anymore.
You can use the following SQL commands to manage your Oracle database. See the subsections below for more information.
Connect to the Database Using Oracle EZ Connection
To connect to the database using the sqlplus client through Oracle EZ Connection method enter the following (replace the text highlighted in yellow with real data).
sqlplus persephone/myPassword@mydomain.com:1521/my-inst
Transferring a File from a Server's Datapump Repository
To transfer a file from an Oracle server's datapump repository enter the following (replace the text highlighted in yellow with real data).
BEGIN
DBMS_FILE_TRANSFER.PUT_FILE(
source_directory_object => 'DATA_PUMP_DIR',
source_file_name => 'sourcefilename.dmp',
destination_directory_object => 'DATA_PUMP_DIR',
destination_file_name => 'destinationfilename.dmp',
destination_database => 'destination_persephone'
);
END;
/
*** DBMS_FILE_TRANSFER.GET_FILE is the opposite of DBMS_FILE_TRANSFER.PUT_FILE.
List Files in the Datapump Repository
To list the files in the datapump repository enter the following (replace the text highlighted in yellow with real data).
select * from table(RDSADMIN.RDS_FILE_UTIL.LISTDIR('datapump-dir'));
List File Contents
To view the contents of a file enter the following (replace the text highlighted in yellow with real data).
select * from table(RDSADMIN.RDS_FILE_UTIL.READ_TEXT_FILE('DATA_PUMP_DIR',
'test.log' ))
The example above would display the contents of a file called "test.log".
Deleting Files
To remove a file enter the following (replace the text highlighted in yellow with real data).
exec utl_file.fremove( 'DATA_PUMP_DIR', 'test.log' );
The example above would delete a file called "test.log".
Re-sizing a Tablespace
To re-size a tablespace enter the following (replace the text highlighted in yellow with a real values).
create tablespace persephone datafile size 150G ;
The example above would re-size the tablespace persephone to 150GB.
Importing the Datapump File to an Oracle Server
The following shows an example of importing a datapump file to an Oracle server running on Linux. Replace the text highlighted in yellow with actual data.
nohup \
impdp persephone/myPassword@mydomain.com:1521/my-inst\
remap_schema=GV_PLANTS_MODEL:persephone \
directory=DATA_PUMP_DIR \
dumpfile=dumpfilename.dmp logfile=logfilename.log &